package com.example.mallsystem1104.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.mallsystem1104.entity.Order;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

/**
 * @Author zy
 * @Date 2024/12/12 16:18
 * @packageName:com.example.mallsystem1104.mapper
 * @ClassName:OrderMapper
 */
@Mapper
public interface OrderMapper extends BaseMapper<Order> {

    @Update("update t_order set state='已支付' where order_no=#{orderNo}")
    void payOrder(String orderNo);

    List<Map<String,Object>> selectByUserId(int userid);

    Map<String, Object> selectByOrderNo(String orderNo);

    @Update("update t_order set state='已收货'where order_no=#{orderNo}")
    boolean receiveOrder(String orderNo);
}
